package timing.ukulele.common.data;

import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;

public interface DtoBaseDataConverter<P,D,V> extends BaseDataConverter<P,V> {
    P d2p(D var1);

    default List<P> d2pList(List<D> list) {
        if (CollectionUtils.isEmpty(list)) {
            return new ArrayList(0);
        } else {
            List<P> pList = new ArrayList(list.size());
            list.forEach((p) -> {
                pList.add(this.d2p(p));
            });
            return pList;
        }
    }

}
